package com.dianrui.agent.util;

import android.widget.Toast;

import me.drakeet.support.toast.ToastCompat;


public class ToastUtil {
    private static ToastCompat MyToast;
    private static final String SYN = "syn";

    public static void showToast(String msg) {
        if(Static.CONTEXT==null){
            return;
        }
        synchronized (SYN) {
            if (MyToast == null) {
                MyToast = ToastCompat.makeText(Static.CONTEXT, "", Toast.LENGTH_SHORT);
            }
            if (!StringUtils.isEmpty(msg)){
                MyToast.setText(msg);
                MyToast.show();
            }
        }
    }
}

